"""account_book URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from app01 import views
from django.conf.urls import url
from django.contrib import admin
from app01 import views
from django.views.static import serve
from account_book import settings
urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^register/', views.register),
    url(r'^login/', views.login),

    # 图片验证码相关路由
    url(r'^get_code/',views.get_code),

    # 修改用户头像
    # url(r'^edit_avatar/',views.edit_avatar),
    # 主页
    url(r'^home/',views.home),
    # 注销
    url(r'^logout/',views.logout),
    # 修改密码
    url(r'^set_password/',views.set_password),

    # 手动暴露后端文件夹资源
    url(r'^media/(?P<path>.*)',serve,{"document_root":settings.MEDIA_ROOT}),

    url(r'^$',views.home),
    # 赊账展示页
    url(r'ac_booklist/',views.book_list,name='list'),
    # 赊账新增
    url(r'^add_book/',views.add_book,name='add'),
    # 赊账删除
    url(r'^delete_book/(?P<delete_id>\d+)/',views.delete_book,name='delete'),
    # # 赊账编辑
    url(r'^edit_book/(?P<edit_id>\d+)/',views.edit_book,name='edit'),

    # 还款记录展示
    url(r'ac_booklist1/',views.book_1_list,name='list1'),
    url(r'^add_book1/',views.add_book1,name='add1'),
    # 赊账删除
    url(r'^delete_book1/(?P<delete_id>\d+)/',views.delete_book1,name='delete1'),
    # # 赊账编辑
    url(r'^edit_book1/(?P<edit_id>\d+)/',views.edit_book1,name='edit1'),


    # 还款结清展示
    url(r'ac_booklist2/',views.book_2_list,name='list2'),
    url(r'^add_book2/',views.add_book2,name='add2'),
    # 赊账删除
    url(r'^delete_book2/(?P<delete_id>\d+)/',views.delete_book2,name='delete2'),
    # 赊账编辑
    url(r'^edit_book2/(?P<edit_id>\d+)/',views.edit_book2,name='edit2'),
]
